import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpCourseDuration {
  id!: number;
  userId!: number;
  sid!: number;
  time!: string;
  duration!: number;
  uniacid!: number;
  courseId!: number;
  addTime!: string;
  conDay: number = 0;
  deviceType!: number;
}

export const ImsYzdKpCourseDurationSchema = new EntitySchema({
  class: ImsYzdKpCourseDuration,
  properties: {
    id: { primary: true, type: 'number' },
    userId: { type: 'number', index: 'user_id' },
    sid: { type: 'number', index: 'sid' },
    time: { type: 'string', length: 255 },
    duration: { type: 'number' },
    uniacid: { type: 'number', index: 'uniacid' },
    courseId: { type: 'number', index: 'course_id' },
    addTime: { type: 'string', columnType: 'date' },
    conDay: { type: 'number', default: 0 },
    deviceType: { type: 'number', fieldName: 'deviceType' },
  },
});
